vr2-3-33.wrl


[ VRML source code ]

#VRML V2.0 utf8
#vr2-3-33.wrl
#Piramid
Shape {
  geometry IndexedLineSet {
    coord Coordinate {
      point [ 
         10  10 0, 
        -10  10 0, 
        -10 -10 0, 
         10 -10 0,
          0   0 15 
      ]
    }
    coordIndex [ 
          0, 1, -1,   # line 0
          1, 2, -1,   # line 1
          2, 3, -1,   # line 2
          3, 0, -1,   # line 3
          4, 0, -1,   # line 4
          4, 1, -1,   # line 5
          4, 2, -1,   # line 6
          4, 3, -1    # line 7
    ]
    color Color {
      color [
          1 0 0,      # color 0
          0 1 0,      # color 1
          0 0 1,      # color 2
          1 1 0,      # color 3
          1 0 1,      # color 4
          0 1 1,      # color 5
          1 1 1,      # color 6
          0.5 0.5 0.5 # color 7
      ]
    }
    colorIndex [ 1,1,1,2,3,3,4,5 ]
    colorPerVertex FALSE
  }
}